import axios from 'axios'

const httpInstance = axios.create({
    baseURL: 'http://pcapi-xiaotuxian-front-devtest.itheima.net',
    // baseURL: 'https://pcapi-xiaotuxian-front-devtest.itheima.net/home/category/head',
    timeout: 9000,
});


//axios请求拦截器
httpInstance.interceptors.request.use(
  config => {
    return config
  },
  error => Promise.reject(error)
)


//axios响应拦截器
httpInstance.interceptors.response.use(
  (res) => {
    return res
  },
  (error) => {
    return Promise.reject(error)
  }
)

export default httpInstance
